UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qC2iBNlEi2PW/8rVv1nxJQAyzVeUh4eNrm+WhobN3vg='
WHERE
key_id = '94aa60a971f2159a12c4b375134eb42465c8bb4fdd68f4d0e56e0ac28332c2fa'
AND (
token = 'qC2iBNlEi2PW/8rVv1nxJQAyzVeUh4eNrm+WhobN3vg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)