UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l+sN2tG2c9t7eQhQ4W2zYba8uVYajDSRt688CUIN8LI='
WHERE
key_id = 'cf534f2cce65ed7b6ef78ad7b3a4cdf157a5746c4d5570fe4157648c64a83c67'
AND (
token = 'l+sN2tG2c9t7eQhQ4W2zYba8uVYajDSRt688CUIN8LI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)