UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vDSKDGhnrtoDGISliQVn4eLt9fzIHaEb6E3s7Yql+w0=' 
WHERE 
  key_id = 'e2b11afbbb3600fe800cfd8bcbbd711027f0e03a09802ab0ccd27e1052d904aa' 
  AND (
    token = 'vDSKDGhnrtoDGISliQVn4eLt9fzIHaEb6E3s7Yql+w0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055