UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AeHH2qQ3i1pbI7FjtHAQQRoW0U5AqWTCazzjqX6C0TM='
WHERE
key_id = '7805b4ce06be4ad5d02ba693da9ac78a31c2b3d25541e2488bbc65cd7c8daef8'
AND (
token = 'AeHH2qQ3i1pbI7FjtHAQQRoW0U5AqWTCazzjqX6C0TM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)