UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pqg5R2nsjn9bfIvy+Tr6rKLwsOtutgxc0lpv0N2BEQY=' 
WHERE 
  key_id = '82f1851a888c229e578c84dd7d7da733c083fe36b0378de16b7bfd594b39fb6e' 
  AND (
    token = 'Pqg5R2nsjn9bfIvy+Tr6rKLwsOtutgxc0lpv0N2BEQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019