UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g4iatskuQFyNKyGp1yZXJ55isEI/cKqnGRuJFVc8Xbw='
WHERE
key_id = '12d86163a209cf328f4bfb1779d9c482ca2f1d3034c87fdce4cd44ec5b675e69'
AND (
token = 'g4iatskuQFyNKyGp1yZXJ55isEI/cKqnGRuJFVc8Xbw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)