UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yiXLCKaRlTCZKecMjJBSE0uL25AgJN4fQPzCu1dTUYI='
WHERE
key_id = '6468d28dc23b37ea74a01eb722bf659684299f95d2055a91584f0d1eaada2937'
AND (
token = 'yiXLCKaRlTCZKecMjJBSE0uL25AgJN4fQPzCu1dTUYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)