UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'elJ59QNfOUcYQrac8RmTBjnQSKkOpU3fPpJ1shrRHB4='
WHERE
key_id = '4e60a2c072583f4d15cd556101067047b8eb0dd03dc9befb26ac1b5f937bdc6d'
AND (
token = 'elJ59QNfOUcYQrac8RmTBjnQSKkOpU3fPpJ1shrRHB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)