UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'azLCAapGn8Nuvb9F4C1lqh9dLVVaIJJnH5lk+DSk8jo='
WHERE
key_id = 'abf84305136201653d5dde04c66607ad3c41fddfc55691991c468680b9378696'
AND (
token = 'azLCAapGn8Nuvb9F4C1lqh9dLVVaIJJnH5lk+DSk8jo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)