UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3f2xBbHYXkx9MH8yPeZiREGd64/RfIqOupHAEpDUfLA='
WHERE
key_id = '2a532f930993898a35b762b74c4d3cba1c8ebef4609e131dad59c7945bda5a80'
AND (
token = '3f2xBbHYXkx9MH8yPeZiREGd64/RfIqOupHAEpDUfLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)