UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WSZ9DKoKDjDgRitspRJ5Z8chTCKTtWChRejpGOkpthc='
WHERE
key_id = 'de55b22d139829477bcbe15e658f1a4ec6e38c995bb05dd2878485d7d8f160c9'
AND (
token = 'WSZ9DKoKDjDgRitspRJ5Z8chTCKTtWChRejpGOkpthc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)