UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TquA2kQEU1qXC0mDKU899Ht2Sfu9T7bMbQDnqXWvgSk=' 
WHERE 
  key_id = '8205947805e8326aecdceaba98c9583317ff0e68a8f47ad5ea8607aaf9088be8' 
  AND (
    token = 'TquA2kQEU1qXC0mDKU899Ht2Sfu9T7bMbQDnqXWvgSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039