UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JmquzhVs5UTiq4/88zUFeokrFXEfGgj13SLnruTtsaw='
WHERE
key_id = '356922edc8d4987b38b6bc0fbb2245bb257df988de38d806ab4e593d0b0c6690'
AND (
token = 'JmquzhVs5UTiq4/88zUFeokrFXEfGgj13SLnruTtsaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)