UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'INzEnFojGwKEQ1MoSI4jJoAiHxHgU2g9qrNryjAY+OQ='
WHERE
key_id = '4c3f9a5ddf4182910578aa70228f55766ea67186b66a4d05e57c5003635888a0'
AND (
token = 'INzEnFojGwKEQ1MoSI4jJoAiHxHgU2g9qrNryjAY+OQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)