UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N48SBqhyok7lU81rHtp0fzopNShCzEiySzZMju8PcLc='
WHERE
key_id = '6e1dfede9b6f80bcc0bba70f57707b8ae43be14ec1f79ba154568a80990f9fc3'
AND (
token = 'N48SBqhyok7lU81rHtp0fzopNShCzEiySzZMju8PcLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)