UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xuec2EUK7KUwfW0T3cfXl9C8BXoehGMk72MDfW0jdt8=' 
WHERE 
  key_id = '92c07e72c392bdb8ac90cee9d1498515f04e2ea61408d6e44b380840ef7197e1' 
  AND (
    token = 'Xuec2EUK7KUwfW0T3cfXl9C8BXoehGMk72MDfW0jdt8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032