UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '48fdFaLoaTGZ1H02iQ67Q8UfHfGVFdZT0A4gyg6RU0U='
WHERE
key_id = '2bb716464b3411ea9fdfb418260efd85e94dce958f11af848bda3e927cb219cb'
AND (
token = '48fdFaLoaTGZ1H02iQ67Q8UfHfGVFdZT0A4gyg6RU0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)