UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PchvpViXVLtGSW4+Sa1MNjXJBD/Y86NUnlAr+hS0vfw='
WHERE
key_id = '32b1c1e0a75f1a38a8a0768f6a979d369247301d533954abdadcfa0920282a5f'
AND (
token = 'PchvpViXVLtGSW4+Sa1MNjXJBD/Y86NUnlAr+hS0vfw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)