UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A25/KzuuG8BV1sz/Tr7r0NmTEzwnrjACTtgg9PC1rZc='
WHERE
key_id = '4512ef63ee6c684891775366d4e62c53fb74790f9b330205eb90989d1fa5d172'
AND (
token = 'A25/KzuuG8BV1sz/Tr7r0NmTEzwnrjACTtgg9PC1rZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)