UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cQC6KZ3oCTz88awa2ksFLM20xd4Uxa+NoNYHhHijvHo='
WHERE
key_id = '83086fe2eb9153d0fc9a666c984749b4bcea70e9904ecd4038057f7ec167888c'
AND (
token = 'cQC6KZ3oCTz88awa2ksFLM20xd4Uxa+NoNYHhHijvHo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)