UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vRkaIvo4VqT4xPY2AiQ3Iv86GvG7uMYbb+T4WZUMna0=' 
WHERE 
  key_id = 'ed7984f820ad20d0ff0e45299713f7295fde7855634973e20b221db03c81cf67' 
  AND (
    token = 'vRkaIvo4VqT4xPY2AiQ3Iv86GvG7uMYbb+T4WZUMna0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067