UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OMx7lPU/BfuRsWKkFsg81MrV+CdU2oywgq4wjUB5AJk='
WHERE
key_id = 'a599cc1543d19a7e1a454b8cbce429e19f76d63d6928a473c305b5bab303e061'
AND (
token = 'OMx7lPU/BfuRsWKkFsg81MrV+CdU2oywgq4wjUB5AJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)