UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HOJMRntxlbAmirS/NVlDykxMg0wj4HUR1DpcFtS6T6U='
WHERE
key_id = 'fd29ce571247030d6c543ce84740cd7fea855a4caee11dee74085130323e3c6f'
AND (
token = 'HOJMRntxlbAmirS/NVlDykxMg0wj4HUR1DpcFtS6T6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)