UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '26v6PnoGj2HZKeUrLp2HQE2DQj2OIm3cgn8fiwgnlP8='
WHERE
key_id = '08082a3220f4fff31264c03ac59667ba93baa21f8fa528299e3a0d4f0fba304a'
AND (
token = '26v6PnoGj2HZKeUrLp2HQE2DQj2OIm3cgn8fiwgnlP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)