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