UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qzhz6COSvpSNvaWaaco+Y6ge6Awo0I/ZVwUP/jNMJIM='
WHERE
key_id = 'f1e961bb20b424b1b58688bffffba3b82cb31a7bf32eb0dc2aa1a3cd74cd9e60'
AND (
token = 'qzhz6COSvpSNvaWaaco+Y6ge6Awo0I/ZVwUP/jNMJIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)