UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cI/zlrkYYNugySQS429fWukoQobO6B8i8QOZmN2Z4gM='
WHERE
key_id = 'f4651af015d0aa2ce6e8a91077170c0778d5028897f95aeaaaa93ca2672ea137'
AND (
token = 'cI/zlrkYYNugySQS429fWukoQobO6B8i8QOZmN2Z4gM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)