UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WvMtv1atrBzH6ZtTBxxjHAQFHDK8Q1keEEpCIXDh0N4=' 
WHERE 
  key_id = '91cb42ad504bdc15230c367cb6ca947b43b8b56f406b579e36c5bbcfbff1416e' 
  AND (
    token = 'WvMtv1atrBzH6ZtTBxxjHAQFHDK8Q1keEEpCIXDh0N4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018