UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'In/lOICQ0vsXcCO6RlWMpRrpP4D4O1Hf0Q/r9HdCkUw='
WHERE
key_id = 'b88422075426559db6fcede7e1d1a305eaa213415b4eefd913547d94d7ece604'
AND (
token = 'In/lOICQ0vsXcCO6RlWMpRrpP4D4O1Hf0Q/r9HdCkUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)