UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K1c3lEFNrfOo2U5C39y9Nq7DcZeByKqIjZP838IsUt8='
WHERE
key_id = '96ffc2f326288342170bbc3783aeecdff6da4f10c00081fb464dcf4a9353ab39'
AND (
token = 'K1c3lEFNrfOo2U5C39y9Nq7DcZeByKqIjZP838IsUt8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)