UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eWY2iY+VqkIBaucJSK4QJ8SS0OnJYK7ig0LLsLQaJzI=' 
WHERE 
  key_id = 'a779ded41115e7bf84046508df95ecfa1f638d36f1ac7af3ce3e0ca17e1fd6d3' 
  AND (
    token = 'eWY2iY+VqkIBaucJSK4QJ8SS0OnJYK7ig0LLsLQaJzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035