UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tujXpZb3jpsHxFqDoIapvcDpGnQ4PhLuwC800inNgUc='
WHERE
key_id = '1c86e361d13c8aa1781bdcba8df2f48f5fc9ef4335ba9ed2798df25138b2a6d5'
AND (
token = 'tujXpZb3jpsHxFqDoIapvcDpGnQ4PhLuwC800inNgUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)