UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fvVun9osn0o8dBea7uHzkeHTRmsqc1UfBtBj4yHIGZI='
WHERE
key_id = 'bfbadfc0dd186cdcf03fdabb48d9fcac70abb748f8d5d7580a2ad21a61620180'
AND (
token = 'fvVun9osn0o8dBea7uHzkeHTRmsqc1UfBtBj4yHIGZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)